all: g_cli  libsyncer.so clean
CC = g++
INCLUDE = -I/usr/lib/jvm/java-6-sun-1.6.0.22/include -I/usr/lib/jvm/java-6-sun-1.6.0.22/include/linux
#CC = arm-none-linux-gnueabi-g++
LINKOPTION = -shared #-static
COMPILEOPTION = -fPIC 
g_cli: cli_main.o watcher.o  file_transfer.o writen.o readn.o 
	$(CC) -o g_cli  cli_main.o watcher.o  file_transfer.o writen.o readn.o -lpthread
libsyncer.so: syncer.o watcher.o  file_transfer.o writen.o readn.o
	$(CC) -o libsyncer.so $(COMPILEOPTION) $(LINKOPTION)  watcher.o  file_transfer.o writen.o readn.o syncer.o -lpthread
syncer.o: syncer.cpp syncer.h gsyncer.h
	$(CC) -c $(COMPILEOPTION) $(INCLUDE) syncer.cpp
cli_main.o: cli_main.cpp gsyncer.h
	$(CC) -c $(COMPILEOPTION) cli_main.cpp
watcher.o: watcher.cpp
	$(CC) -c $(COMPILEOPTION) watcher.cpp
file_transfer.o: file_transfer.cpp  gsyncer.h
	$(CC) -c $(COMPILEOPTION) file_transfer.cpp
writen.o: writen.cpp  gsyncer.h
	$(CC) -c $(COMPILEOPTION) writen.cpp
readn.o: readn.cpp    gsyncer.h
	$(CC) -c $(COMPILEOPTION) readn.cpp
clean:
	rm *.o
